'''
A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence "The quick brown fox jumps over the lazy dog" is a pangram, because it uses the letters A-Z at least once (case is irrelevant).

Given a string, detect whether or not it is a pangram. Return True if it is, False if not. Ignore numbers and punctuation.

'''
'''
思路如下：
  1、先使用正则，替换掉所有的非单词符号 \W
  2、将所有字符转换为小写，在使用 set() 进行去重
  3、如果长度 == 26 则说明 is a pangram   return True
'''
# 方式一：
import string
import re

def is_pangram(s):
    s1 = re.sub(r'[^a-zA-Z]','',s)
    s_set = set(s1.lower())
    return True if len(s_set) == 26 else False

# 方式二：
# import string

# def is_pangram(s):
#     return set(string.lowercase) <= set(s.lower())

# Test
pangram = "The quick, brown fox jumps over the lazy dog!"
print(is_pangram(pangram))

'''
总结：
  方式二用到了 set 中集合判断的方式，使用包含关系，设计的更为巧妙
'''